package com.zr.service.impl;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.zr.dao.BaseDao;
import com.zr.datamodel.UserDM;
import com.zr.service.RoleService;
import com.zr.service.UserService;

@Service("userService")
public class UserServiceImpl implements UserService {

	@Resource
	private BaseDao<UserDM> baseDao;
	
	@Override
	public UserDM findUserByAccountAndPassword(UserDM user) {
		String hql = "from UserDM u where u.account=? and u.password=?";
		return baseDao.get(hql, new Object[]{user.getAccount(),user.getPassword()});
	}

}
